* {
  padding: 0;
  margin: 0;
}
html,
body {
  height: 100%;
  width: 100%;
  background-image: linear-gradient(120deg, #487eb0, #fbc531);
  overflow: hidden;
}
.container {
  position: absolute;
  height: 350px;
  width: 600px;
  background-color: rgba(255, 255, 255, 0.9);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(17, 39, 59, 0.8);
  border: 1px solid rgba(17, 39, 59, 1);
  overflow: hidden;
  box-sizing: border-box;
  opacity: 0;
  transition: 1s;
}
.container-show {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.title {
  margin-top: 10px;
  position: relative;
  height: 40px;
  width: 100%;
  font-size: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  /* 
    text-transform 属性控制文本的大小写:
        capitalize	文本中的每个单词以大写字母开头
        uppercase	定义仅有大写字母
        lowercase	定义无大写字母，仅有小写字母
        inherit	规定应该从父元素继承 text-transform 属性的值
  */
  font-weight: 500;
  letter-spacing: 3px;
  transition: 0.6s;
}
/* 输入框样式 */
.input {
  width: 400px;
  height: 45px;
  position: relative;
  margin: 40px auto;
}
input {
  width: 100%;
  height: 100%;
  position: relative;
  border: none;
  outline: none;
  padding-left: 15px;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 45px;
  transition: 0.6s;
}
/* 登录按钮样式 */
.btn {
  width: 160px;
  height: 50px;
  position: relative;
  margin: -10px auto;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.6s;
}
.login-btn:hover {
  color: white;
  box-shadow: rgba(255, 187, 187, 0.1);
  background-color: #57606f;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
}
/* 登录框样式 */
.login-box {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: rgba(17, 39, 59, 0.8);
  z-index: 1;
  transform-origin: 0 100%;
  /* transform-origin:设置旋转元素的基点位置(x,y,z) */
  transition: 0.6s;
}
.login-box .title {
  color: white;
  text-shadow: 0 0 7px rgba(255, 255, 255, 0.9);
}
/* :focus选择获得焦点的输入字段，并设置其样式 */
.login-box input:focus {
  box-shadow: 0 0 10px rgba(1, 1, 1, 0.8);
}
.login-box input {
  caret-color: white;
  /* caret-color:改变光标颜色 */
  color: rgba(255, 255, 255, 0.8);
}

/* 鼠标悬浮，样式显现 */
.container:hover .title {
  font-size: 20px;
}
.container:hover .input {
  transform: translate(0, -30%);
}
.container:hover .btn {
  height: 30px;
  width: 90px;
  transform: translate(0, -30%);
  font-size: 12px;
}
.container:hover .change-box {
  height: 200px;
}
.container:hover .change-btn {
  display: block;
}

/* 注册样式 */
.change-box {
  position: absolute;
  height: 0;
  width: 100%;
  clip-path: polygon(100% 50%, 50% 100%, 100% 100%);
  /* clip-path: polygon裁剪多边形：（x,y,z）=> 定义三个点，根据宽高进行点与点之间的连线形成图案 */
  bottom: 0;
  transition: 0.6s;
  background-color: #fff;
}
.change-btn {
  position: absolute;
  bottom: 30px;
  right: 40px;
  font-size: 20px;
  display: none;
  font-weight: 500;
}
.change-btn:hover {
  text-shadow: 0 0 3px rgba(200, 200, 200, 0.8);
  /* text-shadow 属性向文本设置阴影 */
  cursor: pointer;
}

/* 注册框 */
.sign-box {
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  transform-origin: 0 100%;
  transform: rotate(90deg);
  transition: 0.6s;
  z-index: 1;
}
.sign-box .title {
  text-shadow: 0 0 10px rgba(200, 200, 200, 0.8);
  font-weight: 500;
}
.sign-change {
  background-color: rgba(17, 39, 59, 0.8);
}
.toLogin {
  color: white;
}
.sign-box input {
  box-shadow: 0 0 3px black;
}
.sign-box .btn {
  color: #1e90ff;
  background-color: rgba(200, 200, 200, 0.1);
  transition: 0.5s;
}
.sign-box .btn:hover {
  color: white;
  background-color: #1e90ff;
}

/* 登录注册切换效果 */
.animate_login {
  transform: rotate(-90deg);
}
.animate_sign {
  transform: rotate(0deg);
}

/* 苹果三色按钮 */
.apple-btn {
  position: absolute;
  height: 15px;
  width: 65px;
  top: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.apple-btn li {
  list-style: none;
  position: relative;
  height: 15px;
  width: 15px;
  border-radius: 15px;
  background-color: #1e90ff;
  margin: 1px;
  opacity: 0;
}
.container:hover .apple-btn .red-btn {
  background-color: red;
  opacity: 1;
  transition: 0.3s;
}
.container:hover .apple-btn .yellow-btn {
  background-color: yellow;
  opacity: 1;
  transition: 0.6s;
}
.container:hover .apple-btn .green-btn {
  background-color: rgba(15, 136, 15);
  opacity: 1;
  transition: 0.9s;
}
.login-apple {
  left: 5px;
}
.sign-apple {
  right: 5px;
}
/* 自适应 */
@media (max-width: 450px) {
  .container {
    height: 350px;
    width: 320px;
  }
  .title {
    height: 30px;
    font-size: 15px;
  }
  .input {
    width: 250px;
    height: 45px;
  }
  .btn {
    width: 120px;
    height: 35px;
  }
  .change-btn span {
    font-size: 16px;
  }
  .change-btn {
    right: 20px;
  }
}
